package bairui.international.model.domain.jpa;

/**
 *
 * @see TB_BranchCompanyStaffMoneyRecord 分公司员工金额记录
 *
 */
public class TestData_TB_BranchCompanyStaffMoneyRecord
{

	private final static org.apache.commons.text.RandomStringGenerator Generator = new org.apache.commons.text.RandomStringGenerator.Builder().withinRange(new char[][]{{'a','z'}, {'A','Z'}, {'0','9'}}).build();

	@SuppressWarnings({ "unchecked", "rawtypes" })
	@org.springframework.transaction.annotation.Transactional(rollbackFor=java.lang.Throwable.class)
	public static TB_BranchCompanyStaffMoneyRecord saveMust(
		org.springframework.context.ApplicationContext context,
		bairui.international.model.domain.jpa.TB_BranchCompanyStaff branchCompanyStaff
	){
		org.springframework.data.jpa.repository.JpaRepository repository = (org.springframework.data.jpa.repository.JpaRepository)context.getBean("repository_BranchCompanyStaffMoneyRecord");
		return (TB_BranchCompanyStaffMoneyRecord)repository.save(newMust(
				branchCompanyStaff
			));
	}
	
	public static TB_BranchCompanyStaffMoneyRecord newMust(
		bairui.international.model.domain.jpa.TB_BranchCompanyStaff branchCompanyStaff
	){
		return new TB_BranchCompanyStaffMoneyRecord(new TB_BranchCompanyStaffMoneyRecord.MustProperties() {
			/** 金额 */
			@Override public Double getMoney(){
				return com.sh_lianjing.test.random.Util_GenerateRandom.doubleRandom(Long.MIN_VALUE, Long.MAX_VALUE);
			}
			/** 剩余金额 */
			@Override public Double getCurrentMoney(){
				return com.sh_lianjing.test.random.Util_GenerateRandom.doubleRandom(0, Long.MAX_VALUE);
			}
			/** 类型 */
			@Override public bairui.international.model.type.Type_BranchCompanyStaffMoneyRecord getType(){
				return bairui.international.model.type.Type_BranchCompanyStaffMoneyRecord.Withdraw;
			}
			/** 分公司员工 */
			@Override public bairui.international.model.domain.jpa.TB_BranchCompanyStaff getBranchCompanyStaff(){
				return branchCompanyStaff;
			}
			/** 剩余可提现总金额 */
			@Override public Double getCurrentWithdrawMoney(){
				return com.sh_lianjing.test.random.Util_GenerateRandom.doubleRandom(0, Long.MAX_VALUE);
			}
		});
	}
	

	@SuppressWarnings({ "unchecked", "rawtypes" })
	@org.springframework.transaction.annotation.Transactional(rollbackFor=java.lang.Throwable.class)
	public static TB_BranchCompanyStaffMoneyRecord saveAll(
		org.springframework.context.ApplicationContext context,
		bairui.international.model.domain.jpa.TB_BranchCompanyStaffRoyaltyRecord branchCompanyStaffRoyaltyRecord
	,bairui.international.model.domain.jpa.TB_BranchCompanyStaffWithdrawOrder branchCompanyStaffWithdrawOrder
	,bairui.international.model.domain.jpa.TB_BranchCompanyStaff branchCompanyStaff
	){
		org.springframework.data.jpa.repository.JpaRepository repository = (org.springframework.data.jpa.repository.JpaRepository)context.getBean("repository_BranchCompanyStaffMoneyRecord");
		return (TB_BranchCompanyStaffMoneyRecord)repository.save(newAll(
				branchCompanyStaffRoyaltyRecord
				,branchCompanyStaffWithdrawOrder
				,branchCompanyStaff
			));
	}
	
	public static TB_BranchCompanyStaffMoneyRecord newAll(
		bairui.international.model.domain.jpa.TB_BranchCompanyStaffRoyaltyRecord branchCompanyStaffRoyaltyRecord
	,bairui.international.model.domain.jpa.TB_BranchCompanyStaffWithdrawOrder branchCompanyStaffWithdrawOrder
	,bairui.international.model.domain.jpa.TB_BranchCompanyStaff branchCompanyStaff
	){
		return new TB_BranchCompanyStaffMoneyRecord(
			new TB_BranchCompanyStaffMoneyRecord.MustProperties() {
				/** 金额 */
				@Override public Double getMoney(){
					return com.sh_lianjing.test.random.Util_GenerateRandom.doubleRandom(Long.MIN_VALUE, Long.MAX_VALUE);
				}
				/** 剩余金额 */
				@Override public Double getCurrentMoney(){
					return com.sh_lianjing.test.random.Util_GenerateRandom.doubleRandom(0, Long.MAX_VALUE);
				}
				/** 类型 */
				@Override public bairui.international.model.type.Type_BranchCompanyStaffMoneyRecord getType(){
					return bairui.international.model.type.Type_BranchCompanyStaffMoneyRecord.Withdraw;
				}
				/** 分公司员工 */
				@Override public bairui.international.model.domain.jpa.TB_BranchCompanyStaff getBranchCompanyStaff(){
					return branchCompanyStaff;
				}
				/** 剩余可提现总金额 */
				@Override public Double getCurrentWithdrawMoney(){
					return com.sh_lianjing.test.random.Util_GenerateRandom.doubleRandom(0, Long.MAX_VALUE);
				}
			},
			new TB_BranchCompanyStaffMoneyRecord.OptionalSingleProperties() {
				/** 分公司员工提成记录 */
				@Override public bairui.international.model.domain.jpa.TB_BranchCompanyStaffRoyaltyRecord getBranchCompanyStaffRoyaltyRecord(){
					return branchCompanyStaffRoyaltyRecord;
				}
				/** 分公司员工提现单 */
				@Override public bairui.international.model.domain.jpa.TB_BranchCompanyStaffWithdrawOrder getBranchCompanyStaffWithdrawOrder(){
					return branchCompanyStaffWithdrawOrder;
				}
			}
		);
	}
	

}
